package org.multimedia.jolitorask.telephone;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;

import org.multimedia.jolitorask.utilisateur.UtilisateurLocal;


public abstract class TelephoneEntity implements EntityBean{

	private static final long serialVersionUID = 1L;

	  // Contexte de l'EJB
	  @SuppressWarnings("unused")
	  private EntityContext context;
	   
	
	  public abstract void setId(Integer i);
	  public abstract Integer getId();
	  
	  public abstract void setNom(String i);
	  public abstract String getNom();
	  
	  public abstract void setNumero(String i);
	  public abstract String getNumero();
	  
	  public abstract String getPassword();
	  public abstract void setPassword(String pass);

	  public abstract void setPriorite(Integer i);
	  public abstract Integer getPriorite();
	  
	  public abstract UtilisateurLocal getUtilisateur();
	  public abstract void setUtilisateur(UtilisateurLocal u);
	  
	  public Integer ejbCreate(Integer id, String nom, String pass, UtilisateurLocal user) throws CreateException {
	  
		  setId(id);
		  setNom(nom);
		  setPassword(pass);
		  setPriorite(0);
		  
		  
		  return id;
	  }

	  
    public void ejbPostCreate(Integer id, String nom, String pass, UtilisateurLocal user) throws EJBException{
    	
    	setUtilisateur(user);
    	
	}
	  
	public void ejbActivate() throws EJBException, RemoteException {
	}

	public void ejbLoad() throws EJBException, RemoteException {
	}

	public void ejbPassivate() throws EJBException, RemoteException {
	}

	public void ejbRemove() throws RemoveException, EJBException, RemoteException {
	}

	public void ejbStore() throws EJBException, RemoteException {
		// TODO Auto-generated method stub

	}

	public void setEntityContext(EntityContext arg0) throws EJBException,
			RemoteException {
		context = arg0;

	}

	public void unsetEntityContext() throws EJBException, RemoteException {
		context = null;
	}

}
